#include "circle.h"

Circle::Circle(QObject* parent) :Shape(parent)
{
}

Circle::~Circle()
{
}

void Circle::drawShape(QPaintDevice* parent)
{
	QPainter painter(parent);
	painter.setRenderHint(QPainter::Antialiasing);
	QTransform transform;
	qreal scaleFactor = getShapeScale();
	transform.scale(scaleFactor, scaleFactor);
	painter.setTransform(transform);
	qreal width = qreal(getBorderWidth());
	Qt::PenStyle borderStyle = getBorderStyle();
	QRgb borderColor = getBorderColor();
	QRgb shapeColor = getShapeColor();
	painter.setPen(QPen(QColor(borderColor), width, borderStyle));
	painter.setBrush(QBrush(QColor(getShapeColor())));
	painter.drawEllipse(getShapeRect());
}

ShapeType Circle::getShapeType()
{
	return ShapeType::CircleShapeType;
}